export type KeyPointBodyType = {
  score: number;
  part: keyof typeof part_map_body;
  parent: keyof typeof part_map_body;
  position: number[]
};

// 关节映射
export const part_map_body = {
  nose: '鼻子',
  neck: '脖子',
  belly: '肚子',
  // 左
  leftEye: '左眼',
  leftEar: '左耳',
  leftShoulder: '左肩',
  leftElbow: '左肘',
  leftWrist: '左腕',
  leftHip: '左髋',
  leftKnee: '左膝',
  leftAnkle: '左踝',
  // 右
  rightEye: '右眼',
  rightEar: '右耳',
  rightShoulder: '右肩',
  rightElbow: '右肘',
  rightWrist: '右腕',
  rightHip: '右髋',
  rightKnee: '右膝',
  rightAnkle: '右踝'
};

// 连接顺序
export const link_map_body = {
  neck: 'nose',
  belly: 'neck',
  // 左
  leftEye: 'nose',
  leftEar: 'leftEye',
  leftShoulder: 'neck',
  leftElbow: 'leftShoulder',
  leftWrist: 'leftElbow',
  leftHip: 'belly',
  leftKnee: 'leftHip',
  leftAnkle: 'leftKnee',
  // 右
  rightEye: 'nose',
  rightEar: 'rightEye',
  rightShoulder: 'neck',
  rightElbow: 'rightShoulder',
  rightWrist: 'rightElbow',
  rightHip: 'belly',
  rightKnee: 'rightHip',
  rightAnkle: 'rightKnee'
} as { [key in keyof typeof part_map_body]: string };